const app = getApp();
const Url = app.globalData.Url
//请求数据
let UserID = "201701031229AA";
let loadMore = function(that) {
  that.setData({
    // hidden: false
  });
  wx.request({
    url: Url + '/dianjia/expressenhance/getSentExpList',
    data: {
      "UserID": UserID,
    },
    method: 'GET',
    header: {
      'content-type': 'application/json'
    },
    success: res => {
      console.log(res)
    },
    fail: err => {
      console.log(err)
    },
    complete: () => {

    }
  })
}
// pages/express-delivery/history.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    params: [],
    hidden: true,
    hasmoreData: true
  },

  Back: () => {
    wx.navigateBack({
      delta: 1
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let that = this
    wx.request({
      url: Url + '/dianjia/expressenhance/getSentExpList',
      data: {
        UserID: UserID,
        page: 1,
        size: 5
      },
      method: 'GET',
      header: {
        'content-type': 'application/json'
      },
      success: res => {
        console.log(res)
        this.setData({
          params: res.data.rows
        })
      },
      fail: err => {
        console.log(err)
      }
    })
    // this.getList()
  },
  getList: function() {
    // if (that.data.count != -1 && that.data.page * that.data.num >= that.data.count) {
    //   that.setData({
    //     hasmoreData: false,
    //     hiddenloading: true
    //   })
    //   return
    // }
  },
  //搜索栏
  onHidden: function(e) {
    let index = e.currentTarget.dataset.bindex;
    let arr = this.data.params;
    let arrCut = 'params[' + index + '].cut'
    if (arr[index].cut === true) {
      this.setData({
        [arrCut]: false
      })
    } else {
      this.setData({
        [arrCut]: true
      })
    }
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})